import Cookies from 'js-cookie'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

export function setupElementPlus(app) {
    /* icon */
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        app.component(key, component)
    }
    /* element-plus */
    app.use(ElementPlus, {
        locale: zhCn,
        size: Cookies.get('size') || 'default'
    })
};
